package com.woniuxy.ticketuser.ticketuser.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.ticketuser.ticketuser.entity.User;
import com.woniuxy.ticketuser.ticketuser.mapper.UserMapper;
import com.woniuxy.ticketuser.ticketuser.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author booty
 * @since 2021-02-22
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Resource
    private UserMapper userMapper;

    //下订单后增加用户积分
    @Override
    public void updateIntegration(int id) {
        User user1 = userMapper.selectById(id);
        user1.setIntegration(user1.getIntegration() + 100);
        userMapper.updateById(user1);
    }
}
